package Gui;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JPanel;

public class GameFrame extends JPanel
{
	public static GameFrame ref;
	/**
	 * Creates an GameFrame Singleton
	 * @return GameFrame Object
	 */
	public static GameFrame getInstance()
	{
		if (ref == null)
			// it's ok, we can call this constructor
			ref = new GameFrame();
		return ref;
	}

	/**
	 * Constructor
	 * @param Size
	 *            (800,600)
	 * @param Resizable
	 *            (False)
	 * @param Title
	 *            ("PayDay! with Java")
	 */
	private static final int FRAME_WIDTH = 700;
	private static final int FRAME_HEIGHT = 660;
	public Dimension getMinimumSize(){	
		return new Dimension(FRAME_WIDTH,FRAME_HEIGHT); 
	}
	public Dimension getPreferredSize(){
		return new Dimension(FRAME_WIDTH,FRAME_HEIGHT);
	}
	public Dimension getMaximumSize(){
		return new Dimension(FRAME_WIDTH,FRAME_HEIGHT);
	}
	public GameFrame()
	{
		setName("PayDay! with Java");
		// make the frame half the height and width
		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
		int height = screenSize.height;
		int width = screenSize.width;
		setSize(width / 2, height / 2);
		setLayout(new BorderLayout());
		setVisible(true);
		
	}
	public void update(){
		// if game is live
		GamePanel.getInstance().update();
	}
	private static final long serialVersionUID = -5674122410142457138L;

}